#ifndef BEHAVIOUR_INFO_H_
#define BEHAVIOUR_INFO_H_

class BPhysicsActor;
class btVector3;
class Grid;

#include <btBulletDynamicsCommon.h>
#include <list>
typedef btAlignedObjectArray<BPhysicsActor*> vActors;

/* Designed to simplify passing data into various behaviours.
   Actors fill a BehaviourInfo up with info once per frame, and pass it in
   to CalcMotion
*/
class BehaviourInfo
{
public:
    /* Default Ctr */
    BehaviourInfo() :
        m_sourceActor(NULL),
        m_targetActor(NULL),
        m_fleeTollerance(0.0f),
        m_arriveParameter(0.0f),
        m_maxVelocity(0.0f),
        m_circleRadius(0.0f),
        m_circleDistance(0.0f),
        m_circleAdjust(0.0f),
        m_targetPosition(0),
        m_extrudeDistance(0.0f),
        m_avoidFactor(0.0f),
        m_avoidStopFactor(0.0f),
        m_avoidanceWeight(0.0f),
        m_wallAvoidanceFactor(0.0f),
        m_wallAvoidDistance(0.0f),
        m_targetNode(-1),
        m_currentTarget(-1),
        m_grid(NULL){}
/************************************************************************/
/* SET FUNCTIONS                                                        */
/************************************************************************/
public:
    void SetSourceActor(BPhysicsActor* val) { m_sourceActor = val; }   
    void SetFleeTollerance(float val) { m_fleeTollerance = val; }    
    void SetArriveParameter(float val) { m_arriveParameter = val; }    
    void SetMaxVelocity(float val) { m_maxVelocity = val; }
    void SetTargetActor(BPhysicsActor* val) { m_targetActor = val; }
    void SetCircleRadius(float val) { m_circleRadius = val; }   
    void SetCircleDistance(float val) { m_circleDistance = val; }
    void SetCircleAdjust(float val) { m_circleAdjust = val; }
    void SetTargetPosition(btVector3* val) { m_targetPosition = val; }
    void SetActors(vActors* val) { m_actors = val; }
    void SetExtrudeDistance(float val) { m_extrudeDistance = val; }
    void SetAvoidFactor(float val) { m_avoidFactor = val; }
    void SetAvoidStopFactor(float val) { m_avoidStopFactor = val; }
    void SetAvoidanceWeight(float val) { m_avoidanceWeight = val; }
    void SetWallAvoidanceFactor(float val) { m_wallAvoidanceFactor = val; }
    void SetWallAvoidDistance(float val) { m_wallAvoidDistance = val; }
    void SetTargetPathNode(int val) {m_targetNode = val;}
    void SetGrid(Grid* g){m_grid = g;}
    void SetCurrentTarget(int val){m_currentTarget = val;}

/************************************************************************/
/* GET FUNCTIONS                                                        */
/************************************************************************/
public:
    BPhysicsActor* GetSourceActor() const { return m_sourceActor; }    
    float GetMaxVelocity() const { return m_maxVelocity; }    
    float GetArriveParameter() const { return m_arriveParameter; }
    float GetFleeTollerance() const { return m_fleeTollerance; }
    BPhysicsActor* GetTargetActor() const { return m_targetActor; }
    btVector3* GetTargetPosition() const { return m_targetPosition; }
    float GetCircleAdjust() const { return m_circleAdjust; }
    float GetCircleDistance() const { return m_circleDistance; }
    float GetCircleRadius() const { return m_circleRadius; }
    vActors* GetActorVector() { return m_actors; }
    float GetExtrudeDistance() const { return m_extrudeDistance; }
    float GetAvoidFactor() const { return m_avoidFactor; }
    float GetAvoidStopFactor() const { return m_avoidStopFactor; }
    float GetAvoidanceWeight() const { return m_avoidanceWeight; }
    float GetWallAvoidanceFactor() const { return m_wallAvoidanceFactor; }
    float GetWallAvoidDistance() const{return m_wallAvoidDistance;}
    //Changed to allow message passing
    int& GetTargetPathNode()  {return m_targetNode; }
    int& GetCurrentTarget()  {return m_currentTarget;}
    Grid* GetGrid() const {return m_grid;}
    std::list<int>& GetPath(){return m_path;}
/***************/
/* MEMBER DATA */
/***************/
private:
    /* Base */
    BPhysicsActor* m_sourceActor;
    BPhysicsActor* m_targetActor;
    float m_maxVelocity;

    /* fleeing */
    float m_fleeTollerance;

    /* Arriving */
    float m_arriveParameter;

    /* Wandering */
    float m_circleRadius;
    float m_circleDistance;
    float m_circleAdjust;  
    btVector3* m_targetPosition;

    /* Avoiding */
    vActors* m_actors;
    float m_extrudeDistance;
    float m_avoidFactor;
    float m_avoidStopFactor;
    float m_avoidanceWeight;
    float m_wallAvoidanceFactor;
    float m_wallAvoidDistance;

    /* Path following */
    Grid* m_grid;
    int m_targetNode;
    int m_currentTarget;
    std::list<int> m_path;
};

#endif

